package com.ita.validator.impl;

import java.util.ArrayList;
import java.util.List;

import com.ita.validator.IValidator;

public class UserNameValidator implements IValidator {

	private final String NOT_NULL_MSG="Name caon not be empty";
	private final String NAME_LENGTH="The length of Name can not less than 3";
	public List<String> validate(String s) {
		List<String> errMsg=new ArrayList<String>();
		if("".equals(s)){
			errMsg.add(NOT_NULL_MSG);
		}
		else if(s.length()<3){
			errMsg.add(NAME_LENGTH);
		}
	
		
		return errMsg;
	}

}
